import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'ble2318ota_plugin_platform_interface.dart';

class MethodChannelBle2318otaPlugin extends Ble2318otaPluginPlatform {
  @visibleForTesting
  final methodChannel = const MethodChannel('ble2318ota_plugin');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  @override
  void startOta(String path) {
    methodChannel.invokeMethod('startOta',{
      'path':path});
  }


  @override
  void initBlueTools() {
    methodChannel.invokeMethod('initBlueTools');
  }


  @override
  void otaListener(Future<dynamic> Function(MethodCall call)? handler){
    methodChannel.setMethodCallHandler(handler);
  }


  @override
  Future<List<int>> checkFiles(String binPath,String checkPath) async{
    return await methodChannel.invokeMethod('checkFiles',{"binPath":binPath,"checkPath":checkPath});
  }

  @override
  void stopScan() {
    methodChannel.invokeMethod('stopScan');
  }

}
